package com.settlement.system.converter;

import com.alibaba.excel.converters.AutoConverter;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import com.settlement.system.common.enums.UnificationProblemDescEunm;

/**
 * 问题描述转化
 *
 * @author Ximi
 * @since 2020/08/19
 */
public class UnificationProblemDescConvert extends AutoConverter {

    @Override
    public WriteCellData convertToExcelData(Object value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) {
        if (null != value) {
            String problemDesc = UnificationProblemDescEunm.decode(Integer.parseInt(value.toString()));
            return new WriteCellData(problemDesc);
        } else {
            return new WriteCellData();
        }
    }
}
